<?php
	$date = DateTime::createFromFormat('Y-m-d', $student->dob)->format('F d, Y');
	$bdate = explode(' ',$student->dob);
	$bdate_at = explode('-',$bdate[0]);
	$created = explode(' ',$student->created);
	$created_at = explode('-',$created[0]);
	//var_dump($payee);
?>

<link rel="stylesheet" href="<?=style_url('yahoocssreset');?>">
<link rel="stylesheet" href="<?=style_url('formletter');?>">

<table border="0" cellpadding="0" cellspacing="0" style="width:818px; font-size:13px;">
<tr><td colspan="4" style="height:50px;">&nbsp;</td></tr>
<tr>
	<td style="width:49px;">&nbsp;</td>
	<td valign="top" style="width:360px;">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr><td style="padding:4px;">&nbsp;&nbsp;&nbsp;&nbsp;Payee</td></tr>
			<tr><td style="width:250px;">
				<table border="0" cellpadding="0" cellspacing="0" style="width:250px; border:#000 1px solid;">
					<tr><td style="padding-top:4px; padding-bottom:3px; padding-left:4px;"><?php echo ucwords(strtolower($payee->lastname)).', '.ucwords(strtolower($payee->firstname)); ?><?php echo $payee->middlename!='' ? " ".ucwords($payee->middlename):""; ?> <?php if($payee->name_ext!=''){ echo $payee->name_ext=='jr' || $payee->name_ext == 'sr' ? ucwords(strtolower($payee->name_ext)):strtoupper($payee->name_ext); }else{ echo ''; } ?></td></tr>
					<tr><td style="padding-top:3px; padding-bottom:3px; padding-left:4px;"><?php if($payee->relation!=''){ echo $payee->relation!='' ? ucwords($payee->relation):"For"; }else{ echo '&nbsp;'; } ?></td></tr>
					<tr><td style="padding-top:3px; padding-bottom:3px; padding-left:4px;"><?php echo ucwords(strtolower($student->lastname)).', '.ucwords(strtolower($student->firstname)); ?><?php echo $student->middlename!='' ? " ".ucwords($student->middlename):""; ?> <?php if($student->name_ext!=''){ echo $student->name_ext=='jr' || $student->name_ext == 'sr' ? ucwords(strtolower($student->name_ext)):strtoupper($student->name_ext); }else{ echo ''; } ?></td></tr>
					<tr><td style="padding-top:3px; padding-bottom:4px; padding-left:4px;"><?php echo $student->level_desc."-SY".$student->e_sy_from."-".$student->e_sy_to; ?></td></tr>
				</table>
			</td><td style="width:100px; vertical-align:bottom;">
				<table border="0" cellpadding="0" cellspacing="0">
					<tr><td style="padding:4px; text-align:center;">ID#</td></tr>
					<tr><td style="padding:4px; border-top:#000 1px solid; border-right:#000 1px solid; border-bottom:#000 1px solid; width:100px;"><?php echo $student->e_student_id!=''?$student->e_student_id:'&nbsp;';?></td></tr>
				</table>
			</td></tr>
		</table>
	</td>
	<td valign="top" style="width:360px;">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td>
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td style="width:120px;">&nbsp;</td>
							<td style="text-align:center; padding:4px; width:120px;">Date</td>
							<td style="text-align:center; padding:4px; width:118px;">UR/OR#</td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td style="text-align:center; padding:4px; border:#000 1px solid;"><?php echo date('m/d/Y',strtotime($dater)); ?></td>
							<td style="text-align:center; padding:4px; border-top:#000 1px solid; border-right:#000 1px solid; border-bottom:#000 1px solid;"><?php echo $af->or_no;?></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr><td>&nbsp;</td></tr>
			<tr>
				<td>
					<table border="0" cellpadding="0" cellspacing="0" style="border:#000 1px solid;">
						<tr>
							<td style="text-align:center; padding:4px; border-right:#000 1px solid; border-bottom:#000 1px solid; width:120px;">Cheque No.</td>
							<td style="text-align:center; padding:4px; border-right:#000 1px solid; border-bottom:#000 1px solid; width:120px;">Payment Method</td>
							<td style="text-align:center; padding:4px; border-bottom:#000 1px solid; width:118px;">Due Date</td>
						</tr>
						<tr>
							<td style="text-align:center; padding:4px; border-right:#000 1px solid;"><?php if($af->spr_mode_of_payment=='check/cheque'){ echo $af->cheque_no; }elseif($af->spr_mode_of_payment=='credit'){ echo $af->credit_card_no; }elseif ($af->spr_mode_of_payment=='cash') { echo'&nbsp;'; }else{ echo '&nbsp;'; } ?><?php echo $af->cheque_no; ?></td>
							<td style="text-align:center; padding:4px; border-top:#000 1px solid; border-right:#000 1px solid; border-left:#000 1px solid;"><?php echo $af->spr_mode_of_payment=='credit'?ucwords($af->credit_card_name):ucwords($af->spr_mode_of_payment); ?></td>
							<td style="text-align:center; padding:4px;"><?php echo date('m/d/Y',strtotime($af->payment_date)); ?></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</td>
	<td style="width:49px;"></td>
</tr>
<tr><td colspan="4">&nbsp;</td></tr>
<tr><td>&nbsp;</td><td colspan="2">
<table border="0" cellpadding="0" cellspacing="0" style="border:#000 1px solid;">
	<tr><td style="width:110px; text-align:center; border-bottom:#000 1px solid; border-right:#000 1px solid; padding:4px;">Fees</td><td style="width:268px; text-align:center; border-bottom:#000 1px solid; border-right:#000 1px solid; padding:4px;">Description</td><td style="width:100px; text-align:center; border-bottom:#000 1px solid; border-right:#000 1px solid; padding:4px;">Qty</td><td style="width:120px; text-align:center; border-bottom:#000 1px solid; border-right:#000 1px solid; padding:4px;">Price</td><td style="width:120px; text-align:center; border-bottom:#000 1px solid; padding:4px;">Amount</td></tr>
	<tr><td style="height:220px; vertical-align:top; border-bottom:#000 1px solid; border-right:#000 1px solid; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:4px;"><?php echo substr($student->a_f_description,0,15).'...';?></td><td style="vertical-align:top; border-bottom:#000 1px solid; border-right:#000 1px solid; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:4px;"><?php echo $student->a_f_description;?></td><td style="vertical-align:top; border-bottom:#000 1px solid; border-right:#000 1px solid; padding:2px;">&nbsp;</td><td style="vertical-align:top; border-bottom:#000 1px solid; border-right:#000 1px solid; padding-top:2px; padding-right:4px; padding-bottom:2px; padding-left:4px; text-align:right;"><?php echo number_format($student->a_f_price,2,'.',',');?></td><td style="vertical-align:top; border-bottom:#000 1px solid; padding-top:2px; padding-right:4px; padding-bottom:2px; padding-left:4px; text-align:right;"><?php echo number_format($student->a_f_price,2,'.',',');?></td></tr>
	<tr><td colspan="3">&nbsp;</td><td style="border-right:#000 1px solid; padding:4px;">SUBTOTAL</td><td style="padding:4px; text-align:right;">PHP <?php echo number_format($student->a_f_price,2,'.',',');?></td></tr>
</table>
</td><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td colspan="2">
	<table border="0" cellpadding="0" cellspacing="0" style="border-right:#000 1px solid; border-bottom:#000 1px solid; border-left:#000 1px solid;">
		<tr><td style="border-bottom:#000 1px solid; padding-top:4px; padding-right:20px; padding-bottom:4px; padding-left:20px; text-align:center;">Authorized Signature</td></tr>
		<tr><td style="padding-top:10px; padding-right:20px; padding-bottom:10px; padding-left:20px; text-align:center;"><?php echo $af->first_name; ?><?php echo $af->middle_name!=''?" ".$af->middle_name:""; ?> <?php echo $af->last_name; ?> <?php echo $af->name_ext; ?></td></tr>
	</table>
</td><td>&nbsp;</td></tr>
</table>

<?php /*
<div>

	<table cellPadding="0" cellSpacing="2">
		<tr>
			<td style="width:300px; text-align:right; vertical-align: baseline;">
				<p><img src="<?=image_url('school_logo.png');?>" height="120" width="120" style="vertical-align: top;" /></p>
			</td>
			<td style="width:500px; text-align:center;">
				<p style="font-size:20; font-weight:bold; color:#450115;">WESTFIELDS INTERNATIONAL SCHOOL</p>
				<p style="font-size:12; color:#0058DD;"><?php echo $school_address!='' ? $school_address:''; ?></p>
				<p style="font-size:12; color:#0058DD;">Tel. No.&nbsp;<?php echo $school_telephone!='' ? $school_telephone:''; ?> / Mobile No.&nbsp;<?php echo $school_mobile!='' ? $school_mobile:''; ?></p>
				<p style="font-size:12; color:#0058DD;">TIN No. 203-910-363 - Non-Vat</p>
				<p style="font-size:12; color:#0058DD;">&nbsp;</p>
				<p style="font-size:20; font-weight:bold; padding-top:20px;">OFFICIAL RECEIPT</p>
			</td>
			<td style="width:200px; text-align:right;">
				&nbsp;
			</td>
		</tr>
	</table>

</div>

<div style="font-size:16; text-align:center; font-weight:bold; padding-top:20px;">NEW STUDENT ASSESSMENT &amp; APPLICATION FORM</div>

<div style="padding-top:20px;">
<table cellPadding="4" cellSpacing="4">
	<tr><td style="width:170px;"><?php echo $inquiry->p_a_description!='' ? $inquiry->p_a_description:$feedata->fee_name; ?>:</td><td>Php <?php echo $inquiry->p_a_price!=0.00 ? number_format($inquiry->p_a_price,2,'.',','):number_format($feedata->fee_rate,2,'.',','); ?></td></tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td>Student Name:</td><td style="border-bottom:#000 1px solid;"><?=ucwords(strtolower($inquiry->p_a_firstname));?>&nbsp;<?=ucwords(strtolower($inquiry->p_a_middlename));?>&nbsp;<?=ucwords(strtolower($inquiry->p_a_lastname));?></td></tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td>Birthday:</td><td style="border-bottom:#000 1px solid;"><?php echo $date; ?></td></tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td>Age:</td><td style="border-bottom:#000 1px solid;"><?php echo $inquiry->p_a_age; ?> years old</td></tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td>Grade Level:</td><td style="border-bottom:#000 1px solid;"><?php echo $inquiry->level_desc; ?></td></tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td>Cellphone Number:</td><td style="border-bottom:#000 1px solid;"><?php echo $inquiry->p_a_mobile_phone; ?></td></tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td>Schedule of Testing:</td><td style="border-bottom:#000 1px solid;"><?php echo $inquiry->p_a_schedule_for_testing; ?></td></tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td style="vertical-align:top;">How did you hear of us:</td><td><?php echo $inquiry->p_a_hear_from; ?></td></tr>
</table>
</div>
*/ ?>